// useState 同步异步更新问题？


import React, {useState} from 'react'

const Home = () => {

  console.log('组件渲染了')

  const [obj , setObj] = useState({text: 'hello'});


  const changeText = () => {
    setObj({...obj})
  }

  return (
    <div>
      <p>{obj.text}</p>
      <hr />
      <button onClick={changeText}>改变文本</button>
    </div>
  )  
}

export default Home;